﻿

''' <summary>
''' Represents a MeasureGroup
''' </summary>
''' <remarks></remarks>
Public Class MeasureGroup

    Private m_groupID As Integer
    Private m_attrib As AttributionStatusEnum
    Private m_date As DateTime
    Private m_category As CategoryEnum
    Private m_measures As Generic.List(Of Measure)

    ''' <summary>
    ''' A unique grpid (Group Id), useful for performing synchronization tasks.
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property GroupId() As Integer
        Get
            Return m_groupID
        End Get
        Set(ByVal value As Integer)
            m_groupID = value
        End Set
    End Property
    ''' <summary>
    ''' An attrib (Attribute), defining the way the measure was attributed to the user. It may take the values shown in the Attribution status table below.
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property AttributionStatus() As AttributionStatusEnum
        Get
            Return m_attrib
        End Get
        Set(ByVal value As AttributionStatusEnum)
            m_attrib = value
        End Set
    End Property
    ''' <summary>
    ''' The date at which the measure was taken or entered.
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property MeasureGroupDate() As DateTime
        Get
            Return m_date
        End Get
        Set(ByVal value As DateTime)
            m_date = value
        End Set
    End Property
    ''' <summary>
    ''' The category of the group. A measure group can represent either measures captured by the device or objectives set by the user. The category field indicates for each measure group whether the measures in the group are measurements or targets. 
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property Category() As CategoryEnum
        Get
            Return m_category
        End Get
        Set(ByVal value As CategoryEnum)
            m_category = value
        End Set
    End Property


    ''' <summary>
    ''' An array of measures that belong to this particular measure group.
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Function GetMeasures() As Measure()
        Return m_measures.ToArray
    End Function
    ''' <summary>
    ''' Adds a measure to the group
    ''' </summary>
    ''' <param name="item"></param>
    ''' <remarks></remarks>
    Friend Sub AddMeasure(ByVal item As Measure)
        m_measures.Add(item)
    End Sub

    ''' <summary>
    ''' Creates a new MeasureGroup
    ''' </summary>
    ''' <remarks></remarks>
    Public Sub New()
        m_measures = New Generic.List(Of Measure)
    End Sub

End Class
